package com.diwu.diwuoj.judge.codesandbox;

import com.diwu.diwuoj.judge.codesandbox.impl.ExampleCodeSandbox;
import com.diwu.diwuoj.judge.codesandbox.impl.RemoteCodeSandbox;
import com.diwu.diwuoj.judge.codesandbox.impl.ThirdPartyCodeSandbox;

/**
 * @Description  代码沙箱的工厂类
 * @Author diwu
 * @Date 2024/7/1
 */
public class CodeSandBoxFactory {

        public static CodeSandbox newInstance(String type){
            switch (type){
                case"example":
                    return new ExampleCodeSandbox();
                case "remote":
                    return  new RemoteCodeSandbox();
                case "thirdParty":
                    return new ThirdPartyCodeSandbox();
                default:
                    return new ExampleCodeSandbox();
            }
        }
}
